<template>
	<view class="czjz">
		<view class="item"  v-for="(item,index) in List" :key="index">
			<view class="top">
				<view class="left">{{item['jine']}}</view>
				<view class="right red" v-if="item['bz']== '提现失败'">
					{{item['bz']}}
				</view>
				<view class="right blue" v-else-if="item['bz']== '提现中'">
					{{item['bz']}}
				</view>
				<view class="right" v-else>
					{{item['bz']}}
				</view>
			</view>
			<view class="list">
				<view class="listitem">
					<view class="left">手续费</view>
					<view class="right">	{{item['fee']}}</view>
				</view>
				<!-- <view class="listitem">
					<view class="left">开户名</view>
					<view class="right">梁欣欣</view>
				</view> -->
				<view class="listitem">
					<view class="left">提现时间</view>
					<view class="right">{{item['shijian']}}</view>
				</view>
			</view>
		</view>
		<view class="wu" v-if="List.length==0">
			暂无数据
		</view>
	<tui-loadmore :visible="loadding" :index="3" type="primary"></tui-loadmore>
	<tui-nomore :visible="!pullUpOn" bgcolor="#f2f2f2"></tui-nomore>
	</view>
</template>

<script>
		import {
		mapState
	} from 'vuex';
	import tuiIcon from "@/components/icon/icon"
	import tuiLoadmore from "@/components/loadmore/loadmore"
	import tuiNomore from "@/components/nomore/nomore"
	export default {
		data() {
			return {
				pageIndex: 1,
				loadding: false,
				pullUpOn: true,
				List: [],
			}
		},
		components: {
			tuiIcon,
			tuiLoadmore,
			tuiNomore,
		},
	
		methods: {
	
		},
			// 页面上拉触底事件的处理函数
		onReachBottom: function() {
			
			if (!this.pullUpOn) return;
			this.loadding = true;
			
			if (this.List.length >= this.chujindetail.count) {
				this.loadding = false;
				this.pullUpOn = false
			} else {
				this.pageIndex = this.pageIndex + 1;
				var data = {
					token: uni.getStorageSync('token'),
					page:this.pageIndex
				}
				this.$store.dispatch("chujindetail", data)
					.then(res => {
						this.chujindetail.data.forEach((val,index) => {
							this.List.push(val);
						})
						
						this.loadding = false
					})
		
			}
		},
		computed: {
			...mapState([
				"chujindetail"
	
			]),
			
		},
		onLoad: function() {
			var pages = getCurrentPages();
var page = pages[pages.length];
			console.log(pages)
			this.pageIndex = 1;
			var data = {
				token: uni.getStorageSync('token'),
				page:1
			}
			this.$store
				.dispatch('chujindetail', data)
				.then(res => {
					this.List = res.data.data.data;
				})
	
			
		},
	}
</script>

<style lang="scss" scoped src="./index.scss"></style>
